package com.htthorizon.powersupply.controller;

import com.htthorizon.powersupply.domain.LineLoadMonitor;
import com.htthorizon.powersupply.service.LineLoadMonitorService;
import com.htthorizon.powersupply.utils.R;
import com.htthorizon.powersupply.vo.LineLoadMonitorVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Brilliant
 */
@RestController
@RequestMapping("lineLoadMonitor")
public class LineLoadMonitorController {

    @Autowired
    private LineLoadMonitorService lineLoadMonitorService;

    @GetMapping("/getToday")
    public R<List<LineLoadMonitorVo>> getLoadDataToDay() {
        List<LineLoadMonitorVo> list=  lineLoadMonitorService.getLoadDataToDay();
        return R.ok(list);
    }

    @GetMapping("/getRealTime")
    public R<List<LineLoadMonitorVo>> getRealTimeLoadData() {
        List<LineLoadMonitorVo> list=  lineLoadMonitorService.getRealTimeLoadData();
        return R.ok(list);
    }

    @GetMapping("/getAll")
    public R<List<LineLoadMonitorVo>> getAll() {
        List<LineLoadMonitorVo> list=   lineLoadMonitorService.getAll();
        return R.ok(list);
    }
}
